home *** CD-ROM | disk | FTP | other *** search
- Path: news.interlog.com!news
- From: irish01@interlog.com (Brian Aitken)
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: Calling all API experts !!
- Date: 28 Mar 1996 00:34:05 GMT
- Organization: WebBuilders Inc.
- Message-ID: <4jcmpt$cpf@steel.interlog.com>
- References: <DoIMG1.F9y@unx.sas.com> <314fa69d.8181856@news>
- NNTP-Posting-Host: irish01.interlog.com
- X-Newsreader: WinVN 0.99.5
-
- In article <314fa69d.8181856@news>, bking@primenet.com says...
- >
- >On Tue, 19 Mar 1996 12:52:49 GMT, sdkkah@mvs.sas.com wrote:
- >
- >>
- >>Hi, world
- >>
- >>I am trying to make an application with a tool which just recently allowed
- >>calling Windows API's. The tool (The SAS System) itself is written in C++.
- >>Some API's works OK, but there's one I cant figure out how to use right.
- >>Its called GetProfileString. I need to access the [fonts] section of WIN.INI,
- >>and get all entries and values. But I dont know the number of entries to
- >>read, since this obviously varies. Is there some kind of trick that would
- >>allow me to loop through untill the last entry is read, without having to
- >>know the exact number of entries in each section ?
- >>
- >>Getting the font names is just getting me half the way. I also need to
- >>know the point size and property (Bold,Italic etc..). Does anyone know
- >>where I can get this information ?
- >>
- >>Finally, can anyone recommend any good documentations as to how
- >>Windows API's are dealt with in general ?
- >>
- >>All kind of help is appreciated.
- >>
- >You can skip the API when it comes to reading INI files. Use the
- >TIniFile object, it has a method called "ReadSection", this will read
- >all keys into a TStringList then you can loop through each element in
- >the list and read the values associated with the key with the
- >ReadString method of the TIniFile. Once you have built the list of
- >fonts, you can use the API function GetTextMetrics which will return a
- >lot of (if not all) the information you need.
- >
- >
-
- If you read what the guy says he is trying to use an API call from
- SAS/C++ NOT Delphi ...
-
- I suggest he use the GetProfileSection API call ... this will get ALL
- the name/key values at one fell swoop. It's documented in the C++
- manual and in the SDK.
- --
- **************************************************
- Brian Aitken
- WebBuilders Inc.
- **************************************************
-
-